﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using IDE;

namespace neside2
{
    class Plugin_Default : IDE.IPlugin
    {
        public string Name => "_default_";

        public static IDE.I_IDE _IDE
        {
            get;
            private set;
        }
        public IDE.I_IDE IDE
        {
            get
            {
                return _IDE;
            }
            set
            {
                if (_IDE == null)
                    _IDE = value;
            }
        }

        public PanelInfo[] panels => new PanelInfo[]{
            new PanelInfo{ type="output", title="output",description=""}
        };

        public FileTypeDesc[] filetypes => null;

        public ToolBar[] toolbars => null;

        public MenuOption[] MenuItem => new MenuOption[]{
            new MenuOption{ menuPath="Help\\About" , menuType= MenuOption.MenuType.Auto }
        };

        public void CreateEmptyFile(string type, string filename)
        {
            throw new NotImplementedException();
        }

        public UIElement CreatePanelUI(string type)
        {
            if (type == "output")
                return new default_panel.Default_Output();
            throw new NotImplementedException();
        }

        public void OnMenuClick(string path)
        {
            if (path == "Help\\About")
            {
                MessageBox.Show("兔兔加油，从小霸王开始，一点点掌握核心技术");
                return;
            }
            throw new NotImplementedException();

        }

        public IDocument OpenFile(string extname, string filename, bool writeable)
        {
            var ui = new Default_TextEdit();
            return ui.OpenFile(filename, writeable);
        }
    }
}
